import React from 'react';
import { observer } from 'mobx-react';
import ExcelLayout from '../excel-layout';
import { WeaRightMenu } from 'ecCom';
import CardStore from '../../stores/card';
import { MapAddressDialog } from '../cube-map';

export interface PreviewCardProps {
    Card: CardStore;
}

@observer
export class PreviewCard extends React.Component<PreviewCardProps, any> {
    render() {
        const { Card } = this.props;
        const {  iconInfo } = Card;
        return (
            <WeaRightMenu   >
                <div className="cube-card-inline-wrapper cube-card-preview">
                    <div className="cube-card-inline-tab">
                        <div className="cube-card-layout">
                            {Card.isInit && [
                                <ExcelLayout Card={Card} />
                            ]}
                        </div>
                    </div>
                </div>
                <MapAddressDialog mapStore={Card.mapStore} iconInfo={iconInfo}/>
            </WeaRightMenu>
        )
    }
}